Skip to main content

Module Aliases

Catalyst supports module aliases to create shorter, more descriptive import paths. These come pre-configured when setting up a new project.

Default Aliases

AliasPath
@pagessrc/js/pages
@componentssrc/js/components
@containerssrc/js/containers
@reducerssrc/js/reducers
@actionssrc/js/actions
@staticsrc/static
@apisrc/js/api.js
@Fallbacksrc/js/Fallback

Usage

Instead of relative paths:

// Without aliases
import Header from "../../../components/Header/Header";
import homeReducer from "../../../reducers/homeReducer";
import styles from "../../../static/css/base/layout.css";

Use aliases:

// With aliases
import Header from "@components/Header/Header";
import homeReducer from "@reducers/homeReducer";
import styles from "@static/css/base/layout.css";

Benefits

  • Cleaner imports - no more ../../../ chains
  • Easier refactoring - move files without updating import paths
  • Consistent codebase - same import style everywhere